
<template>
  <view>
    <view
      @click="goDetail(item)"
      :key="index"
      v-for="(item, index) in list"
      class="lisBox"
    >
      <view class="liBox">
        <view class="lis">
          <view class="tit">
            {{ item.title }}
          </view>
		  
		  <view v-if="item.mianyi" class="cont">
		    期望月薪：面议
		  </view>
		  
          <view v-else class="cont">
           <view v-if="item.monthly_salary_min || item.monthly_salary_max">
           	期望月薪：{{ item.monthly_salary_min?item.monthly_salary_min:'' }}~{{
           	  item.monthly_salary_max?item.monthly_salary_max:''
           	}}元/月
           </view>
          </view>
		  
		 
		  
          <view class="see">
            访问次数：<u-icon
              class="icon"
              color="#ccc"
              name="eye"
              size="28"
            ></u-icon
            >{{ item.view_count }}
          </view>
        </view>

        <view class="bottom">
          <view @click="edit(item)" class="evaluate btn"
            ><u-icon class="icon" name="edit-pen-fill"></u-icon>修改</view
          >
          <view @click="del(item)" class="del btn"
            ><u-icon class="icon" name="trash-fill"></u-icon>删除</view
          >
        </view>
      </view>
    </view>
    <u-modal @confirm="confirm" :mask-close-able="true" :show-cancel-button="true"  v-model="modalMask" content="确定删除?"></u-modal>
  </view>
</template>

<script>
import api from "../../../../api/routes.js";
export default {
  props: ["list"],
  data() {
    return {
      modalMask: false,
      id:undefined
    };
  },
  methods: {
    edit(row) {
      uni.navigateTo({
        url: `/package/pages/release/recruitment?type=${row.classify}&id=${row.id}&kindWord=${row.groupType}`,
      });
    },
    confirm() {
    this.FnDel();
    },
    async FnDel() {
      const res = await this.$myRequest({
        url: api.delJob,
        method: "GET",
        data: { jobId:this.id },
      });
      if (res.data.code == 0) {
        uni.showToast({
          title: "删除成功",
          duration: 1000,
        });
        this.modalMask = false;
        
        
        this.$emit("refrash", 0);
      }
    },
    del(row) {
      this.id = row.id;
      this.modalMask = true;
    },
    goDetail() {
      if (this.gowhere) {
        uni.navigateTo({
          url: "/package/pages/searchJob/list/detail",
        });
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.liBox {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bottom {
  padding: 0 10rpx;
  .btn {
    height: 52rpx;
    width: 150rpx;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 26rpx;
    border: 2rpx solid $u-border-color;
    font-size: 26rpx;
    text-align: center;
    color: $u-type-info-dark;
    margin-bottom: 10px;
    color: #ffffff;
    .icon {
      margin-right: 4px;
    }
  }
  .evaluate {
    background: $uni-color-warning;
  }
  .del {
    background: $uni-color-error;
  }
}
.lisBox {
  background: #ffffff;
  border-radius: 10rpx;
  margin-bottom: 20rpx;
  padding: 32rpx 10rpx 32rpx 32rpx;
}

.lis {
  flex: 1;
  .tit {
    text-align: justify;
    line-height: 42rpx;
    margin-bottom: 15rpx;
    font-size: 14px;
    font-weight: bold;
    color: #333333;
    // text-overflow: -o-ellipsis-lastline;
    // overflow: hidden;
    // text-overflow: ellipsis;
    // display: -webkit-box;
    // -webkit-line-clamp: 1;
    // line-clamp: 1;
    // -webkit-box-orient: vertical;
  }
  .cont {
    font-size: 12px;
    color: #777;
    line-height: 35rpx;
  }
  .see {
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
    .icon {
      margin-right: 3px;
    }
  }
}
</style>
